package top.lyc829.basic.Unit5;

import java.lang.reflect.InvocationTargetException;
import java.util.Random;

public class Test {

    public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {

        String className = "java.util.Random";

        Class cls = Class.forName(className);
        Object obj = cls.getConstructor().newInstance();
        Random random = (Random) obj;
        System.out.println(random.nextInt());

    }

}
